<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Activity extends DQ_Controller 
{
    public function __construct()
    {   
        parent::__construct();
        $this->load->Model('thread_model');
    }  

    public function getNearby()
    {
        $data = $this->thread_model->getThreadNearby();

        return $this->packData($data);
    }

    public function getSummary()
    {
        $data = $this->thread_model->getThreadSummary();

        return $this->packData($data);
    }

    public function getDetail()
    {
        //活动信息、参与人数、最近的对话
        $data = $this->thread_model->getThreadDetail();

        return $this->packData($data);
    }

    public function getDiscuss()
    {
        $data = $this->thread_model->getDiscuss();

        return $this->packData($data);
    }

    public function getJoinedPeople()
    {
        $data = $this->thread_model->getJoinedPeople();

        return $this->packData($data);
    }

    public function joinActivity()
    {
        $data = $this->thread_model->joinActivity();

        return $this->packData($data);
    }

    public function unjoin()
    {
        $data = $this->thread_model->unjoin();

        return $this->packData($data);
    }

    public function isJoined()
    {
        $data = $this->thread_model->isJoined();

        return $this->packData($data);
    }

    public function createActivity()
    {
        $data = $this->thread_model->addThread();

        return $this->packData($data);
    }

    public function addDiscuss()
    {
        $data = $this->thread_model->addPost();

        return $this->packData($data);
    }

}

